<template>

  <div id="client">
    <div class="client-top" style="">
      供应商：
      <el-input style="width: 200px;margin-left: 10px;margin-right: 20px;" placeholder="请输入客户编号" v-model="input"
        clearable>
      </el-input>

      <el-button slot="reference" style="margin-left:-20px;margin-right:10px"
        @click="dialogFormVisible = true">...</el-button>
      <el-dialog top="20px" title="新增客户" :visible.sync="dialogFormVisible">
        <el-select v-model="value" placeholder="类别">
          <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
          </el-option>
        </el-select>
        <el-input v-model="input" placeholder="请输入内容" style="width: 200px;margin-left: 20px;"></el-input>
        <el-checkbox v-model="checked" style="margin-left: 20px">显示禁用客户</el-checkbox>
        <el-button type="success" style="margin-left: 20px">查询</el-button>
        <el-table :data="gridData">

          <el-table-column type="selection" width="55">
          </el-table-column>
          <el-table-column width="100" property="name" label="类别"></el-table-column>
          <el-table-column width="100" property="address" label="编号"></el-table-column>
          <el-table-column width="300" property="address" label="名称"></el-table-column>
          <el-table-column width="100" property="address" label="联系人"></el-table-column>
          <el-table-column width="100" property="address" label="手机"></el-table-column>
          <el-table-column width="100" property="address" label="备注"></el-table-column>
        </el-table>
        <div class="block">
          <span class="demonstration"></span>
          <el-pagination layout="prev, pager, next" :total="1000">
          </el-pagination>
        </div>
        <div slot="footer" class="dialog-footer">
          <el-button @click="dialogFormVisible = false">取 消</el-button>
          <el-button type="primary" @click="dialogFormVisible = false">确 定</el-button>
        </div>
      </el-dialog>
      总欠款：
      <el-input style="width: 80px;margin-left: 10px;margin-right: 20px;" placeholder="" v-model="input" clearable
        disabled>
      </el-input>
      付款人：
      <el-select v-model="value" placeholder="付款人" style="width: 100px;">
        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      </el-select>


      <span class="demonstration" style="margin-left: 20px;">单据日期:</span>
      <el-date-picker v-model="value2" align="right" type="date" placeholder="选择日期" :picker-options="pickerOptions">
      </el-date-picker>
      <i class="el-icon-paperclip" style="color: blue;margin-left: 40px"></i>
      <sapn style="color: blue;">上传附件</sapn>
      <span style="margin-left: 10px;">单据编号:</span>
      <el-input style="width: 120px;margin-left: 10px;margin-right: 20px;" placeholder="" v-model="input" clearable>
      </el-input>
      <el-dropdown>
        <span class="el-dropdown-link">
          <i class="el-icon-edit"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>SKDYYYYMMDD</el-dropdown-item>
          <el-dropdown-item>狮子头</el-dropdown-item>
          <el-dropdown-item>螺蛳粉</el-dropdown-item>
          <el-dropdown-item disabled>双皮奶</el-dropdown-item>
          <el-dropdown-item divided>蚵仔煎</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
    <div class="client-content" style="margin-top: 10px;">

      <el-table height="200px" :data="tableData" border style="width: 100%;font-size: 13px;">
        <el-table-column fixed prop="" label="" width="50">
        </el-table-column>
        <el-table-column fixed prop="date" label="结算账户" width="150">
          <el-select v-model="value" placeholder="结算账户" style="width: 100px;">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-table-column>
        <el-table-column prop="name" label="付款金额" width="140">
          <el-input style="width: 100px;margin-left: 10px;margin-right: 20px;" placeholder="收款金额" v-model="input"
            clearable>
          </el-input>
        </el-table-column>
        <el-table-column prop="province" label="结算方式" width="140">
          <el-select v-model="value" placeholder="结算方式" style="width: 110px;">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
        </el-table-column>
        <el-table-column prop="city" label="结算号" width="140">
          <el-input style="width: 100px;margin-left: 10px;margin-right: 20px;" placeholder="结算号" v-model="input"
            clearable>
          </el-input>
        </el-table-column>
        <el-table-column prop="address" label="备注" width="300">
          <el-input style="width: 250px;margin-left: 10px;margin-right: 20px;" placeholder="备注" v-model="input"
            clearable>
          </el-input>
        </el-table-column>

      </el-table>
      <div style="width: 100%;background-color: blanchedalmond;height: 30px;">
        <table style="width: 78.7%;height: 30px;">
          <tr>
            <td style="width: 50%;">合计：</td>
            <td style="width: 50%;">123</td>
          </tr>
        </table>
      </div>
      <div style="margin-top: 30px">
        <div style="float:right;"> <el-button @click="choose = true">选择源单</el-button><el-button>自动核销</el-button></div>

        <el-dialog top="20px" title="" :visible.sync="choose">
          <div class="block">
            <span class="demonstration">日期：</span>
            <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
              start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" style="width: 200px">
            </el-date-picker>
            备注：
            <el-input style="width: 100px; margin-left: 10px; margin-right: 20px" placeholder="备注" v-model="input"
              clearable>
            </el-input>
            客户地址:
            <el-input style="width: 120px; margin-left: 10px; margin-right: 20px" placeholder="客户地址" v-model="input"
              clearable>
            </el-input>
            <el-button type="success" style="margin-left: 20px">查询</el-button>
          </div>
          <div>源单编号：
            <el-input style="width: 400px; margin-left: 10px; margin-right: 20px" placeholder="源单编号：" v-model="input"
              clearable>
            </el-input>
            业务员：
            <el-select v-model="value" placeholder="业务员：" style="width: 150px;">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </div>
          <el-table :data="gridData">
            <el-table-column type="selection" width="55"> </el-table-column>
            <el-table-column prop="name" label="订单编号" width="120">
            </el-table-column>
            <el-table-column prop="address" label="业务类别" width="120">
            </el-table-column>
            <el-table-column fixed prop="name" label="订单日期" width="150">
            </el-table-column>
            <el-table-column fixed prop="name" label="销售人员" width="150">
            </el-table-column>
            <el-table-column prop="address" label="客户" width="120">
            </el-table-column>
            <el-table-column prop="name" label="订单金额" width="120">
            </el-table-column>
            <el-table-column prop="address" label="已出库核销金额" width="120">
            </el-table-column>
            <el-table-column prop="address" label="未出库核销金额" width="120">
            </el-table-column>
            <el-table-column prop="address" label="审核状态" width="120">
            </el-table-column>
            <el-table-column prop="address" label="交货日期" width="120">
            </el-table-column>
            <el-table-column prop="address" label="关联销货单号" width="120">
            </el-table-column>
            <el-table-column prop="address" label="关联购货单号" width="120">
            </el-table-column>
            <el-table-column prop="address" label="客户地址" width="120">
            </el-table-column>
            <el-table-column prop="address" label="业务员" width="120">
            </el-table-column>
            <el-table-column prop="address" label="备注" width="120">
            </el-table-column>
          </el-table>
          <div class="block">
            <span class="demonstration"></span>
            <el-pagination layout="prev, pager, next" :total="1000">
            </el-pagination>
          </div>
          <div slot="footer" class="dialog-footer">
            <el-button @click="choose = false">取 消</el-button>
            <el-button type="primary" @click="choose = false">确 定</el-button>
          </div>
        </el-dialog>
        <el-table height="300px" :data="tableData" border style="width: 100%;font-size: 13px;">
          <el-table-column fixed prop="" label="" width="50">
          </el-table-column>
          <el-table-column fixed prop="date" label="源单编号" width="150">
          </el-table-column>
          <el-table-column prop="name" label="业务类别" width="120">
          </el-table-column>
          <el-table-column prop="province" label="单据日期" width="120">
          </el-table-column>
          <el-table-column prop="city" label="收款到期日" width="120">
          </el-table-column>
          <el-table-column prop="zip" label="已核销金额" width="120">
          </el-table-column>
          <el-table-column prop="city" label="未核销金额" width="120">
          </el-table-column>
          <el-table-column prop="address" label="本次核销金额" width="130">
            <el-input style="width: 130px;margin-left: 10px;margin-right: 20px;" placeholder="本次核销金额" v-model="input"
              clearable>
            </el-input>
          </el-table-column>
          <el-table-column prop="zip" label="单据备注" width="120">
          </el-table-column>
        </el-table>
        <el-input type="textarea" :rows="2" placeholder="暂无备注信息" v-model="textarea"
          style="width: 100%;line-height: 20px;">
        </el-input>
        <div style="float:right;margin-right: 20px;margin-top: 10px;">
          本次预付款：
          <el-input style="width: 200px; margin-left: 10px; margin-right: 20px" placeholder="本次预付款：" v-model="input"
            clearable disabled>
          </el-input>
          <el-button>历史单据</el-button><el-button>操作日志</el-button>
        </div>
      </div>
      <div>
      </div>
    </div>
    <div style="height: 20px;clear: both;"></div>
  </div>
</template>

<script>
export default {

  data() {
    return {
      choose: false,
      dialogFormVisible: false,
      gridData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }],
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            picker.$emit('pick', new Date());
          }
        }, {
          text: '昨天',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24);
            picker.$emit('pick', date);
          }
        }, {
          text: '一周前',
          onClick(picker) {
            const date = new Date();
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', date);
          }
        }]
      },
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1518 弄',
        zip: '200333'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1517 弄',
        zip: '200333'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1519 弄',
        zip: '200333'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        province: '上海',
        city: '普陀区',
        address: '上海市普陀区金沙江路 1516 弄',
        zip: '200333'
      }],

      value1: '',
      value2: '',
    };
  }
}
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>